<div class="cil__base-block">
  <img class="cil__top-image" src="assets/images/centaur/change.svg" />

  <form class="cil__base-block--form" [formGroup]="form" nz-form
    *ngIf="isSupportPostRisk || isSupportRisk; else notSupported">
    <!-- TODO: 在这之后填写事中风控的表单
    <ng-container formGroupName="rc" *ngIf="isSupportRisk">
      <app-detail-header [title]="'RISK_CTRL.TITLE.PROCESS_RC_DETAIL' | i18n" [hideIcon]="true">
      </app-detail-header>

    </ng-container>
    -->
    <ng-container formGroupName="postRC" *ngIf="isSupportPostRisk">
      <app-detail-header [title]="'RISK_CTRL.TITLE.POST_RC_DETAIL' | i18n" [hideIcon]="true">
      </app-detail-header>

      <div nz-row [nzGutter]="24">
        <div nz-col [nzSpan]="12">
          <nz-form-item>
            <nz-form-label>{{'BIZ.STORE.OTHER.RC.RC_SCHEME' | i18n}}</nz-form-label>
            <nz-form-control nzHasFeedback="true">
              <app-risk-control-select formControlName="selectedScheme" [isPostpositive]="true" [insCode]="insCode">
              </app-risk-control-select>
              <nz-form-explain>
                <ng-container
                  *ngTemplateOutlet="errorTpl;context:{control:form.get('postRC').get('selectedScheme'), name:'selectedScheme'}">
                </ng-container>
              </nz-form-explain>
            </nz-form-control>
          </nz-form-item>
        </div>
      </div>

      <div nz-row [nzGutter]="24">
        <div nz-col [nzSpan]="12">
          <nz-form-item>
            <nz-form-label>{{'RISK_CTRL.SCHEME_CODE' | i18n}}</nz-form-label>
            <nz-form-control nzHasFeedback="true">
              <input formControlName="schemeCode" name="schemeCode" nz-input />
            </nz-form-control>
          </nz-form-item>
        </div>

        <div nz-col [nzSpan]="12">
          <nz-form-item>
            <nz-form-label>{{'RISK_CTRL.SCHEME_NAME' | i18n}}</nz-form-label>
            <nz-form-control nzHasFeedback="true">
              <input formControlName="schemeName" name="schemeName" nz-input />
            </nz-form-control>
          </nz-form-item>
        </div>

        <div nz-col [nzSpan]="12">
          <nz-form-item>
            <nz-form-label>{{'RISK_CTRL.SCHEME_DESC' | i18n}}</nz-form-label>
            <nz-form-control nzHasFeedback="true">
              <input formControlName="schemeDesc" name="schemeDesc" nz-input />
            </nz-form-control>
          </nz-form-item>
        </div>
      </div>
    </ng-container>
  </form>


  <ng-template #notSupported>
    <div>
      <p class="cil__not-support-tip">{{'BIZ.STORE.OTHER.RC.RC_NOT_SUPPORTED_OF_ACQUIRER' | i18n}}</p>
    </div>
  </ng-template>
</div>

<ng-template #errorTpl let-control="control" let-name="name">
  <ng-container *ngIf="control.dirty">
    <ng-container *ngIf="control.hasError('required');">{{ errorTips[name]?.required }}</ng-container>
  </ng-container>
</ng-template>